export default {
  namespaced: true, //命名空间
  state: {
    //发布测试的卡片data数据
    questionData: [],
    //需要和添加修改的测试题目数据
    TestData: {},
    topicData: [],
  },
  getters: {},
  mutations: {
    //设置测试data数组
    setQuestionData(state, data) {
      state.questionData = data;
    },
    //设置需要修改测试data
    setTestData(state, data) {
      state.TestData={};
      state.TestData = data;
    },
    //设置需要修改测试topicData
    setTopicData(state, data) {
      state.topicData = data;
    },
    //重置testdata
    resetTestData(state) {
      state.TestData = {
        title: DefalultContent(),  
        oldTitle:DefalultContent(),
      };
      state.topicData=[];
    },
  },
  actions: {}, 
};
var DefalultContent = () => {
  var nowDate = new Date();
  let date = {
    month: nowDate.getMonth() + 1,
    date: nowDate.getDate(),
  };
  return date.month + "月" + date.date + "日测试";
};
